<?php

/**
 * Peticion form.
 *
 * @package    SistemaWebUnlSenescyt
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class PeticionForm extends BasePeticionForm
{
  /**
   * @see PersonaForm
   */
      
  protected static $subjects = array(0 => 'M',
        1 => 'F');

    public function configure() {

        $this->widgetSchema->setLabels(array(
            'dni' => 'DNI',
            'first_name' => 'Nombres',
            'last_name' => 'Apellidos',
            'email_address' => 'Correo<br /> Electrónico',
            'sexo' => 'Genero',
            'direccion' => 'Dirrecion<br />Domiciliaria',
            'telefono' => 'Telefono',
            'telefonoMovil' => 'Celular',
        ));


        $this->setWidgets(array(            
            'dni' => new sfWidgetFormInputText(),
            'first_name' => new sfWidgetFormInputText(),
            'last_name' => new sfWidgetFormInputText(),
            'email_address' => new sfWidgetFormInputText(),
            'sexo' => new sfWidgetFormSelect(array('choices' => self::$subjects)),
            'direccion' => new sfWidgetFormInputText(),
            'telefono' => new sfWidgetFormInputText(),
            'telefonoMovil' => new sfWidgetFormInputText(),
        ));

        $this->setValidators(array(            
            'dni' => new sfValidatorInteger(),
            'first_name' => new sfValidatorString(array('max_length' => 25)),
            'last_name' => new sfValidatorString(array('max_length' => 25)),
            'email_address' => new sfValidatorString(array('max_length' => 255)),
            'sexo' => new sfValidatorChoice(array('choices' => array_keys(self::$subjects))),
            'direccion' => new sfValidatorString(array('max_length' => 30)),
            'telefono' => new sfValidatorInteger(),
            'telefonoMovil' => new sfValidatorInteger(),
        ));
        $this->widgetSchema->setNameFormat('persona[%s]');
        parent::configure();
    }    
    
  
}
